<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:oso="http://osoftware.com/facelets"
	template="/WEB-INF/templates/mainSearchLayout.xhtml">

	<ui:define name="title">
			<h:outputText value="#{resourceBundle['bill.title']}" />
	</ui:define>
	
	<ui:define name="searchFields">
		<oso:selectOneMenu id="patientFilter" 
			label="#{resourceBundle['bill.patient']}"
			value="#{billModel.filter.patient}" 
			converter="patientConverter"
			items="#{billModel.selectablePatients}" 
			itemLabel="fullName"/>
	</ui:define>

	<ui:define name="listValues">
		<ui:param name="listModel" value="#{billModel.list}" />
		<ui:param name="targetObject" value="#{billModel.editedEntity}" />
	</ui:define>

	<ui:define name="searchColumns">
		<p:column sortBy="#{row.id}" style="width:50px;">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['bill.id']}" />
			</f:facet>
			<h:outputText id="id" value="#{row.id}" >
			</h:outputText>
		</p:column>
		<p:column sortBy="#{row.date}" style="width:150px;">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['bill.date']}" />
			</f:facet>
			<h:outputText id="date" value="#{row.date}" >
				<f:convertDateTime pattern="dd/MM/yyyy HH:mm" />
			</h:outputText>
		</p:column>
		<p:column sortBy="#{row.patient.fullName}">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['bill.patient']}" />
			</f:facet>
			<h:outputText value="#{row.patient.fullName}" />
		</p:column>
		<p:column sortBy="#{row.amount}" style="width:50px;">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['bill.amount']}" />
			</f:facet>
			<h:outputText value="#{row.amount}" />
		</p:column>
	</ui:define>
</ui:composition>